25b8c0e575f1f62a2746d2574fdea5772858fc60,rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java,WSS4JInOutTest,makeInvocation,#Map#List#Map#,530
Before Change
WSS4JOutInterceptor ohandler = new WSS4JOutInterceptor();
PhaseInterceptor<SoapMessage> handler = ohandler.createEndingInterceptor();
SoapMessage msg = new SoapMessage(new MessageImpl());
Exchange ex = new ExchangeImpl();
ex.setInMessage(msg);
SOAPMessage saajMsg = MessageFactory.newInstance().createMessage();
SOAPPart part = saajMsg.getSOAPPart();
part.setContent(new DOMSource(doc));
saajMsg.saveChanges();
msg.setContent(SOAPMessage.class, saajMsg);
for (String key : outProperties.keySet()) {
msg.put(key, outProperties.get(key));
After Change
WSSecurityEngineResult actionResult =
handlerResults.get(0).getActionResults().get(WSConstants.SIGN).get(0);
X509Certificate certificate =
(X509Certificate) actionResult.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);
assertNotNull(certificate);
}
@Test
public void testDirectReferenceSignature() throws Exception {
Map<String, Object> outProperties = new HashMap<String, Object>();
outProperties.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
outProperties.put(WSHandlerConstants.SIG_PROP_FILE, "outsecurity.properties");
outProperties.put(WSHandlerConstants.USER, "myalias");